<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>WiFi Host Driver Board Support Package Integration (whd-bsp-integration)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">WiFi Host Driver Board Support Package Integration (whd-bsp-integration)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('index.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">WiFi Host Driver Board Support Package Integration </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p ><a class="anchor" id="md_source_support_whd_bsp_integration_README_doxygen"></a> </p>
<h1><a class="anchor" id="autotoc_md1"></a>
Overview</h1>
<p >This library provides some convenience functions for connecting the WiFi Host Driver (WHD) library to a Board Support Package (BSP) that includes a WLAN chip. This library initializes the hardware and passes a reference to the communication interface on the board into WHD. It also sets up the LwIP or NetXDuo based network buffers to be used for sending packets back and forth.</p>
<p >The BSP is expected to set a component indicating what communication interface to use to relay information between the MCU and the WIFI chip. The legal options are restricted based on what MCU and WIFI chips are being used. The selected interface must be supported by both sides. The legal component values are one of:</p><ul>
<li>WIFI_INTERFACE_SDIO</li>
<li>WIFI_INTERFACE_SPI</li>
<li>WIFI_INTERFACE_M2M</li>
</ul>
<p >Some additional customization of the library is possible by setting defines when building the library. If no custom value is provided, the library will pick a reasonable default value. The following options are available for customization:</p><ul>
<li>CY_WIFI_COUNTRY: Defines the country this will operate in for wifi initialization parameters. See the wifi-host-driver's whd_country_code_t for legal options.</li>
<li>CY_WIFI_THREAD_STACK_SIZE: Defines the amount of stack memory available for the wifi thread.</li>
<li>CY_WIFI_THREAD_PRIORITY: Defines the priority of the thread that services wifi packets. Legal values are defined by the RTOS being used.</li>
<li>CY_WIFI_HOST_WAKE_SW_FORCE: Defines whether to use the out-of-band pin to allow the WIFI chip to wake up the MCU.</li>
<li>CY_WIFI_OOB_INTR_PRIORITY: Defines the priority of the interrupt that handles out-of-band notifications from the WIFI chip. Legal values are defined by the MCU running this code.</li>
</ul>
<h1><a class="anchor" id="autotoc_md2"></a>
Getting Started</h1>
<p >To use this library:</p><ol type="1">
<li>Implement the <a class="el" href="group__group__bsp__network__buffer.html#ga3299898b9eba8861438225b85f36f528" title="Called by WHD to pass received data to the network stack.">cy_network_process_ethernet_data()</a> function. This should be something similar to the example below. <div class="fragment"><div class="line"><span class="comment">/* This needs to be the same item as passed to netifapi_netif_add() */</span></div>
<div class="line"><span class="keyword">static</span> <span class="keyword">struct </span>netif *default_interface = NULL;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> <a class="code hl_function" href="group__group__bsp__network__buffer.html#ga3299898b9eba8861438225b85f36f528">cy_network_process_ethernet_data</a>(whd_interface_t iface, whd_buffer_t buf)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">if</span> (default_interface != NULL)</div>
<div class="line">    {</div>
<div class="line">        <span class="keywordflow">if</span> (default_interface-&gt;input(buf, default_interface) != ERR_OK)</div>
<div class="line">            <a class="code hl_function" href="group__group__bsp__network__buffer.html#gaac05ad889f09b6e8ef43503ba475a21f">cy_buffer_release</a>(buf, WHD_NETWORK_RX);</div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">else</span></div>
<div class="line">    {</div>
<div class="line">        <a class="code hl_function" href="group__group__bsp__network__buffer.html#gaac05ad889f09b6e8ef43503ba475a21f">cy_buffer_release</a>(buf, WHD_NETWORK_RX);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="ttc" id="agroup__group__bsp__network__buffer_html_ga3299898b9eba8861438225b85f36f528"><div class="ttname"><a href="group__group__bsp__network__buffer.html#ga3299898b9eba8861438225b85f36f528">cy_network_process_ethernet_data</a></div><div class="ttdeci">void cy_network_process_ethernet_data(whd_interface_t interface, whd_buffer_t buffer)</div><div class="ttdoc">Called by WHD to pass received data to the network stack.</div></div>
<div class="ttc" id="agroup__group__bsp__network__buffer_html_gaac05ad889f09b6e8ef43503ba475a21f"><div class="ttname"><a href="group__group__bsp__network__buffer.html#gaac05ad889f09b6e8ef43503ba475a21f">cy_buffer_release</a></div><div class="ttdeci">void cy_buffer_release(whd_buffer_t buffer, whd_buffer_dir_t direction)</div><div class="ttdoc">Releases a packet buffer.</div><div class="ttdef"><b>Definition:</b> cy_network_buffer_lwip.c:103</div></div>
</div><!-- fragment --></li>
<li>Include a reference to <code>cybsp_wifi.h</code>.</li>
<li>Call <a class="el" href="group__group__bsp__wifi.html#gafc78b1c0b031052308051088ee2021b7" title="Initializes the primary interface for the WiFi driver on the board using the default configuration,...">cybsp_wifi_init_primary()</a> to initialize the interface. This needs to be done after having called cybsp_init().</li>
</ol>
<h1><a class="anchor" id="autotoc_md3"></a>
Features</h1>
<ul>
<li>APIs for setting up the WHD interface with the BSP's SDIO/SPI/M2M interface.<ul>
<li>Initialize a primary WiFi interface</li>
<li>Optionally initialize a secondary WiFi interface</li>
<li>Cleanup interfaces</li>
</ul>
</li>
<li>APIs for connecting WHD to LwIP/NetXDuo memory buffers (whd_buffer_funcs_t)</li>
<li>Framework for connecting WHD to LwIP/NetXDuo network interface (whd_netif_funcs_t)</li>
</ul>
<h1><a class="anchor" id="autotoc_md4"></a>
More information</h1>
<ul>
<li><a href="https://infineon.github.io/whd-bsp-integration/html/modules.html">API Reference Guide</a></li>
<li><a href="http://www.cypress.com">Cypress Semiconductor, an Infineon Technologies Company</a></li>
<li><a href="https://github.com/infineon">Infineon GitHub</a></li>
<li><a href="https://www.cypress.com/products/modustoolbox-software-environment">ModusToolbox™</a></li>
</ul>
<hr  />
<p> © Cypress Semiconductor Corporation (an Infineon company) or an affiliate of Cypress Semiconductor Corporation, 2019-2022. </p>
</div></div><!-- PageDoc -->
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>WiFi Host Driver Board Support Package Integration (whd-bsp-integration)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
